package game;

import java.awt.image.BufferedImage;

public class Cell {
    BufferedImage image;
    private int row;    //私有化 只能在类中使用
    int col;

    public Cell(BufferedImage image, int row, int col) {
        this.image = image;
        this.row = row;
        this.col = col;
    }

    public int getRow() {
        return row;
    }

    public void setRow(int row) {
        this.row = row;
    }

    public int getCol() {
        return col;
    }

    public void setCol(int col) {
        this.col = col;
    }

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

    @Override
    public String toString() {  //toString默认不写类型地址 写具体值
        return "Cell{" +
                "row=" + row +
                ", col=" + col +
                '}';
    }

    //下落
    public void drop() {
        row++;
    }

    //左移动
    public void moveLeft() {
        col--;
    }

    //右移动
    public void moveRight() {
        col++;
    }


}
